import Vue from 'vue'
import VueRouter from 'vue-router'
//默认显示
import index from '../views/index.vue'

Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    name: 'index',
    component: index
  },
  {
    path: '/cart',
    name: 'cart',
   /*路由懒加载*/
    component: () => import(/* webpackChunkName: "about" */ '../views/cart.vue')
  },
    {
      path: '/orderList',
      name: 'orderList',
      /*路由懒加载*/
      component: () => import(/* webpackChunkName: "about" */ '../views/orderList.vue')
    },
    {
      path: '/mycente',
      name: 'mycente',
      /*路由懒加载*/
      component: () => import(/* webpackChunkName: "about" */ '../views/mycente.vue')
    },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
